{include file="common/header"/}
<div class="lemo-container">
    <div class="lemo-main">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>{:lang('config')}{:lang('list')}</legend>
                <blockquote class="layui-elem-quote">

                    <div class="lemo-table">
                        <div class="layui-inline">
                            <input type="text" id='keys' name="keys" lay-verify="required" placeholder="{:lang('pleaseEnter')}" autocomplete="off" class="layui-input">
                        </div>
                        <a href="javascript:;" class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="search" id="search">{:lang('search')}</a>
                        <a href="javascript:;"  class="layui-btn layui-btn-sm layui-btn-warm add" lay-filter="add"  data-href="{:url('configAdd')}" >{:lang('add')}{:lang('config')}</a>
                        <a href="javascript:;"  class="layui-btn layui-btn-sm layui-btn-danger add" lay-filter="group" data-href="{:url('configGroupAdd')}" >{:lang('add')}{:lang('config group')}</a>
                        <a href="javascript:;"  class="layui-btn layui-btn-sm layui-btn-normal add" lay-filter="grouplist" data-href="{:url('configGroup')}">{:lang('config group')}{:lang('list')}</a>

                    </div>

                </blockquote>

            </fieldset>

            <table class="layui-table layui-hide" id="list" lay-filter="list"></table>
    </div>
</div>


<script type="text/html" id="action">
    <a  class="layui-btn  layui-btn-xs" lay-event="edit" data-href="{:url('configEdit')}?id={{d.id}}">{:lang('edit')}</a>
    <a  class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" data-href="{:url('configDel')}">{:lang('del')}</a>
</script>
<script type="text/html" id="status">
    <input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" data-href="{:url('configState')}" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }}>
</script>


{include file="common/footer"/}
<script>
    var tableIn=null;
    layui.config({
        base: "/static/admin/js/",
        version: true
    }).extend({
        Admin: 'Admin'
    }).use(['form', 'table','Admin'], function () {
        var table = layui.table;
        tableIn = table.render({
            elem: '#list',
            url: '{:url("configlist")}',
            method: 'post',
            cols: [[
                {checkbox: true, fixed: true},
                {field: 'id', title: 'ID', width: 80,  sort: true},
                {field: 'code', title: '配置键', width: 120,sort: true},
                {field: 'value', title: '配置值', width: 250,sort: true},
                {field: 'type', title: '分组', width: 250,sort: true},
                {field: 'remark', title: '备注', width: 220,sort:true},
                {field: 'status', title: '状态', width: 180, templet:'#status'},
                {title:'操作',width:120, toolbar: '#action',align:"center"}
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true
        });

    });


</script>